package viettravel.BLL;

import java.util.ArrayList;

import viettravel.DAO.PlaceDAO;
import viettravel.DTO.ViettravelDTO;

public class ViettravelBLL {
	
	ViettravelDTO mViettravelDTO;
	public ViettravelBLL(){
		mViettravelDTO = ViettravelDTO.getInstance();
	}
	
	//FAVORIT
	public ArrayList<PlaceDAO> getListFavorit(){
		ArrayList<PlaceDAO> listFavorit = new ArrayList<PlaceDAO>();
		ArrayList<Integer> listPlaceIdFavorit = mViettravelDTO.findFavorits();
		if(listPlaceIdFavorit.size() == 0)
			return null;
		for(Integer i : listPlaceIdFavorit){
			PlaceDAO placeDAO = mViettravelDTO.findPlaceById(i);
			listFavorit.add(placeDAO);
		}
		return listFavorit;
	}
	
	//
}
